<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>
    <link rel="stylesheet" href="/bootstrap-3.3.7/dist/css/bootstrap.css">
    <link rel='stylesheet' href='/stylesheets/style.css' />
    <link rel="stylesheet" href="/stylesheets/myHome.css">
    <script src="/javascripts/jquery.min.js"></script>
    <script src='/bootstrap-3.3.7/dist/js/bootstrap.min.js'></script>
  </head>
  <body>
    <div class="container-fluid">
      <div class="row">
        <div class="col-md-12 mynav">
          <nav class="navbar navbar-default">
            <div class="container">
              <!-- Brand and toggle get grouped for better mobile display -->
              <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                  <span class="sr-only">Toggle navigation</span>
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="/">主页</a>
              </div>

              <!-- Collect the nav links, forms, and other content for toggling -->
              <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                  <!-- <li><a href="/">新鲜事</span></a></li> -->
                  <!-- <li><a href="#">问答</a></li> -->
                  <li><a href="/yangsheng">养生</a></li>
                  <li><a href="/meishi">美食</a></li>
                  <li><a href="/hufu">护肤</a></li>
                 <!--  <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">我的圈子 <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                      <li><a href="#">佛系排行榜</a></li>
                      <li><a href="#">佛系笔记</a></li>
                      <li><a href="#">佛系活动</a></li>
                    </ul>
                  </li> -->
                </ul>
                <ul class="nav navbar-nav navbar-right">
                 <% if(typeof(username)=='undefined') { %>
                    <li><a class="sm_a" href="/login">登录</a></li>
                    <li><a class="sm_a" href="#">注册</a></li>
                  <% } %>
                  <% if(typeof(username)!='undefined') { %>
                    <% if(username!='') { %>
                      <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><%= username %> <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                          <li><a href="/myHome">我的主页</a></li>
                          <li><a href="/write">写博客</a></li>
                          <li><a href="/setting">资料设置</a></li>
                          <li role="separator" class="divider"></li>
                          <li><a href="/exit">退出登录</a></li>
                        </ul>
                      </li>
                    <% } %>
                    <% if(username=='') { %>
                      <li><a class="sm_a" href="/login">登录</a></li>
                      <li><a class="sm_a" href="#">注册</a></li>
                    <% } %>
                   <% } %>

                </ul>
                <form class="navbar-form navbar-right">
                  <div class="form-group">
                    <input type="text" class="form-control" placeholder="Search">
                  </div>
                  <i class="glyphicon glyphicon-search mysearch"></i>
                </form>
              </div><!-- /.navbar-collapse -->
            </div><!-- /.container-fluid -->
          </nav>
        </div>
      </div>
    </div>
    
    <div class="container-fluid smallnav">
      <div class="row">
        <div class="col-md-12 white">
          <nav class="navbar navbar-default">
            <div class="container">

              <!-- Collect the nav links, forms, and other content for toggling -->
              <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                  <li class="active"><a href="/myHome">我的文章</a></li>
                  <li><a href="/write">写文章</a></li>
                  <li><a href="/setting">资料设置</a></li>
                </ul>
              </div><!-- /.navbar-collapse -->
            </div><!-- /.container-fluid -->
          </nav>
        </div>
      </div>
    </div>

    <section id="main">
      <div class="container">
        <div class="row">
          <div class="col-md-3 right">
            <div class="item_wrap">
              <div class="right_item">
                <div class="item_con">
                  <p class="title">个人资料</p>
                  <figure>
                    <div class="myimg">
                      <img src="/images/1.jpg" alt="">
                    </div>
                  </figure>
                  <h5 class="name"><%=username %></h5>
                </div>
              </div>
              <div class="right_item">
                <div class="item_con">
                  <dl>
                    <dt><a href="">原创</a></dt>
                    <dt><a href="">粉丝</a></dt>
                    <dt><a href="">点赞</a></dt>
                    <dt><a href="">评论</a></dt>
                    <dd><a href="">9</a></dd>
                    <dd><a href="">9</a></dd>
                    <dd><a href="">9</a></dd>
                    <dd><a href="">9</a></dd>
                  </dl>
                </div>
              </div>
            </div>
            <br>
            <div class="item_wrap">
              <div class="right_item">
                <div class="item_con">
                  <p class="title">最新文章</p>
                  <ul class="list-group">
                  <% if(data2.length!=0){ %>
                    <% for (var i=0; i<data2.length; i++) { %>
                      <li class="list-group-item"><a href="/article?title=<%=data2[i].title %>&author=<%=data2[i].author %>"><%=data2[i].title %></a></li>
                    <% } %>
                  <% } %>
                  
                  </ul>
                </div>
              </div>
            </div>
          </div>
          <div class="col-md-9 my_article">
          <%  if (data.length!=0) { %>
           <% for (var i=0; i<data.length; i++) { %>
           <div class="item">
             <figure class="img-responsive">
               <img class="" src="<%=data[i].pic %>" alt="">
             </figure>   
             <aside>
                 <h3><a href="/article?title=<%=data[i].title %>&author=<%=data[i].author %>"><%=data[i].title %></a></h3>
                 <p class="ar_con"><%=data[i].content %></p>
                 <div class="disc">
                   <span class="type"><%=data[i].type %></span>
                   <div class="item_right">
                     <span><%=data[i].author %></span>
                     <time><%=data[i].date %></time>
                   </div>
                   
                 </div>
                 
             </aside>  
           </div>      
          <% } %>
         <% } %>
         <%  if (data.length==0) { %>
          <p class="noarticle">您暂无发表文章</p>
         <% } %>
          </div>


        </div>
      </div>
    </section>
    <%  if (sumPage!=0) { %>
     <div class="container">
        <div class="row">
          <div class="col-md-12 text-center">
            <nav aria-label="Page navigation">
              <ul class="pagination">
                <li>
                  <a href=/myHome?page=pre aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                  </a>
                </li>
               
                  <% for (var i=1; i<=sumPage; i++) { %>
                    <li><a href="/myHome?page=<%=i%>"><%=i%></a></li>
                  <% } %>
                <li>
                  <a href="/myHome?page=next" aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                  </a>
                </li>
              </ul>
            </nav>
          </div>
        </div>
      </div>
    <% } %>
  </body>
</html>